<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>grid</title>
    </head>
    <style>
        .box1 {
            display: grid;
            grid-template-columns: repeat(auto-fit, 200px);
            grid-gap: 50px;
            grid-auto-rows: 50px;
        }
        .box1>div {
            border: 1px solid red;
        }
        
        .box2 {
            display: grid;
            /* grid-template-columns: 100px auto 200px; */
            /* 百分比 */
            /* grid-template-columns: 1fr 2fr 1fr; */
            grid-template-columns: 1fr 1fr minmax(200px, 1fr);
            grid-gap: 50px;
            grid-auto-rows: 50px;
        }
        .box2>div {
            border: 1px solid red;
        }
    </style>
    <body>
        <div class="box1">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
        </div>
        <hr />
        <div class="box2">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
        </div>
    </body>
</html>